package main
import (
	"fmt"
)
//演示golang中基本数据类型的转换
func main() {
	var i  int = 100
//希望将i转换成float
	var n1 float32 = float32(i)
	var n2 int32 = int32(i)
	var n3 int64 = int64(i)
	fmt.Printf("i=%v,n1=%v,n2=%v,n3=%v",i,n1,n2,n3)
	fmt.Printf("i type is %T\n",i)
	var y int = 200
	var n4 int8 = int8(y)
	fmt.Printf("n4=%v\n",n4)
	fmt.Printf("n4 type is %T",n4)
}
